﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Honestysoft.Baseframework.WebUI;
using System.Data;

namespace Honestysoft.Financing.WebUI.Module.Contract
{
    public partial class GetContractLike : BasePage
    {
        protected override void Page_Load(object sender, EventArgs e)
        {
            base.Page_Load(sender, e);
            if (!IsPostBack)
            {
                Bind();
            }
        }

        protected override void SecurityVerify()
        {
            PageSecurity.Edit = true;
        }

        /// <summary>
        /// 绑定页面
        /// </summary>
        private void Bind()
        {
            string val = Request.QueryString["val"];
            string type = Request.QueryString["type"];
            Honestysoft.Financing.BusinessLogic.Contract bll = new BusinessLogic.Contract("");
            DataTable dt = null;
            if (type == "0")
            {
                dt = bll.GetLikeContractByName(val);
            }
            else
            {
                dt = bll.GetLikeContractByPrice(Convert.ToDecimal(val));
            }
            rptList.DataSource = dt;
            rptList.DataBind();
        }
    }
}